home *** CD-ROM | disk | FTP | other *** search
- Const PendownCount:Word=0;
-
- Procedure Tausche(Var X,Y :Integer);
- Var T :Integer;
- begin T:=X; X:=Y; Y:=T; end;
-
-
- Procedure SetPen(Color :GrColor);
- Var Pen :GrColor;
- begin
- Pen :=PenLookUp[Color];
- If (Color > 0) and (Color<= Succ(MaxLayer)) and (Pen<>PlOldPen) Then
- Begin
- PlOldPen:=Pen;
- With Setupinfo.PinstInfo do
- If SelpenCom<>'' then
- If NoError Then
- begin
- {$I-}
- Write(PrOutFile,SelpenCom,Pen,EndSym);
- If AufDatei Then NoError:=IOresult=0;
- {$I+}
- end;
- End;
- end;
-
-
- Procedure Pencolor(Color :GrColor); { = Pen-Nummer }
- Begin
- GrDrawColor:=Color;
- End;
-
- Procedure CheckPen(Var DrawMode:Str15);
- {für Emulation getsrichelter Linien}
- begin
- With Setupinfo.PinstInfo do
- If Grdotted=dashed then
- begin
- If S_Count>=0.599 then Drawmode:=MoveCom
- else DrawMode:=DrawCom;
- end
- else
- begin { dotted}
- If S_Count>=0.847 then Drawmode:=MoveCom
- else If S_Count>0.748 then DrawMode:=DrawCom
- else If S_Count>=0.599 then Drawmode:=MoveCom
- else DrawMode:=DrawCom;
- end;
- end;
-
- Procedure CheckCount; {für Emulation getsrichelter Linien}
- begin
- If Grdotted=dashed then
- begin
- If S_Count>=0.998 then
- begin
- S_count:=0;
- S_count_rest:=0.6;
- end
- else
- If S_Count>=0.599 then
- S_count_rest:=0.4
- else S_count_rest:=0.6;
- end
- else {dotted0}
- begin
- If S_Count>=0.996 then
- begin
- S_count:=0;
- S_count_rest:=0.6;
- end
- else If S_Count>=0.847 then S_count_rest:=0.15
- else If S_Count>=0.748 then S_count_rest:=0.1
- else If S_Count>=0.599 then S_count_rest:=0.15
- else S_count_rest:=0.6;
- end;
- end;
-
-
- Procedure Linetype(Typ : GrLineType);
- Begin
- If GrDotted <> Typ Then
- If NoError Then
- With Setupinfo.PinstInfo do
- Begin
- If Emul_LT then
- begin
- If Typ<>LastLineType then
- begin
- Case Typ of
- dotted: begin
- LastLineType:=Typ;
- S_count:=0;
- S_count_rest:=0.6;
- Linienteilung:=PlotKoord(LScaledotted);
- end;
- dashed: begin
- LastLineType:=Typ;
- S_count:=0;
- S_count_rest:=0.6;
- Linienteilung:=PlotKoord(LScaleDashed);
- end;
- end; {Case}
- end; {If Typ<>}
- end
- else
- begin
- {$I-}
- With SetUpInfo.PinstInfo Do
- If HpGl Then
- Case Typ OF
- full : Write(PrOutFile,LTfullCom,EndSym);
- dashed : begin
- RealStr(Lscaledashed*LineScaleFac,6,Outstring);
- Write(PrOutFile,LTdashCom,SepSym,Outstring,EndSym);
- end;
- dotted : begin
- RealStr(Lscaledotted*LineScaleFac,6,Outstring);
- Write(PrOutFile,LTdotCom,SepSym,Outstring,EndSym);
- end;
- End
- else
- Case Typ OF
- full : Write(PrOutFile,LTFullCom,EndSym);
- dashed : Write(PrOutFile,LTdashCom,Endsym,
- LSCom,RealtoInt(Lscaledashed*LineScaleFac),EndSym);
- dotted : Write(PrOutFile,LTdotCom,EndSym,
- LsCom,RealtoInt(Lscaledotted*LineScaleFac),EndSym);
- End;
- If AufDatei Then NoError:=IOresult=0;
- {$I+}
- end;
- GrDotted:=Typ;
- end;
- End;
-
- Procedure FormReals(X:Real;Var S:Str10);
- Var I:Integer;
- begin
- Str(X:7:0,S);
- I:=0;
- Repeat
- I:=Succ(I);
- Until S[I]<>' ';
- Delete(S,1,I-1);
- end;
-
- Procedure DrehenSpiegeln(Var X,Y :Real);
- Var Xtemp :Real;
- begin
- If Portrait Then
- begin
- Xtemp:=X; X:=GrWindowX2-Y; Y:=Xtemp;
- end;
- If Spiegeln then
- Y:=GrWindowY1+(GrWindowY2-Y);
- end;
-
- Procedure RetourAbbild(Var X,Y :Real);
- Var Ytemp :Real;
- begin
- If Spiegeln then Y:=GrWindowY1+(GrWindowY2-Y);
- If Portrait Then
- begin
- Ytemp:=Y;
- Y:=GrWindowX2-X;
- X:=Ytemp;
- end;
- end;
-
- Procedure Moveto(Xz , Yz :Real);
- Var X,Y,X1,X2,Y1,Y2 :Real;
- Ausziehen :Boolean;
- DrawMode :Str15;
- Sx,Sy :Str10;
- Richtung,NewP,
- Start,LastP,Ende :Vektor;
- G1 :Gerade;
- L0,List,Lrel,Sigma :Real;
- Ready :Boolean;
-
- Begin
- X:=PlotKoord(Xz);
- Y:=PlotKoord(Yz);
- DrehenSpiegeln(X,Y);
- X1:=GrCursorX;X2:=X;
- Y1:=GrCursorY;Y2:=Y;
- Ausziehen:=True;
- If ComInstalled then
- With Setupinfo.PinstInfo do
- begin
- If (GrDraWColor<> 0) Then DrawMode:=Drawcom Else DrawMode:=MoveCom;
- If Not(Inwindow(X,Y) and InWindow(GrCursorX,GrCursorY)) Then
- Ausziehen:=Clip(X1,Y1,X2,Y2); { Schittpunkte Existent }
- If Ausziehen Then
- Begin
- If Ungleich(GrOldX,X1) or Ungleich(GrOldY,Y1) Then
- begin
- FormReals(X1,Sx);FormReals(Y1,Sy);
- If NoError Then
- begin {$I-}
- PenDownCount:=0;
- Write(PrOutFile,MoveCom,Sx,SepSym,Sy,EndSym);
- If AufDatei Then NoError:=IOresult=0;
- end; {$I+}
- GrOldX:=X1;GrOldY:=Y1;
- end;
- If Ungleich(GrOldX,X2) or Ungleich(GrOldY,Y2) or
- ((GrDrawColor<>0) and (PendownCount=0)) Then
- begin
- If GrDrawColor<>0 then
- begin
- Inc(PendownCount);
- SetPen(GrDrawColor);
- end else PendownCount:=0;
- If (GrDrawColor<>0) and (Grdotted<>full) and Emul_LT then
- begin
- With Richtung Do begin
- X:=X2-GroldX; Y:=Y2-GroldY;
- Vect_Scale(Richtung,1/Laenge(X,Y));{Einheits-Vektor}
- end;
- Start.X:=GroldX;Start.Y:=GroldY;
- Ende.X:=X2;Ende.Y:=Y2;
- L0:=Distanz_VV(Start,Ende);
- LastP:=Start;
- G1.Richtung:=Richtung; G1.Ort:=Start;
- Sigma:=0; Ready:=false;
- Repeat
- CheckPen(DrawMode);
- S_count:=S_count+S_count_rest;
- Sigma:=Sigma+S_count_rest;
- Get_P_G(G1,NewP,Sigma*Linienteilung);
- List:=Distanz_VV(Start,Newp);
- If List-L0>=0 then
- begin
- Ready:=true;
- Newp:=Ende;
- Lrel:=Distanz_VV(NewP,LastP)/Linienteilung;
- S_count_rest:=S_count_rest-Lrel;
- S_count:=S_count-S_count_rest;
- end
- else CheckCount;
- With NewP do
- begin
- If Ungleich(GRoldX,X) or Ungleich(GrOldY,Y) then
- begin
- FormReals(X,Sx);FormReals(Y,Sy);
- If NoError Then
- begin {$I-}
- Write(PrOutFile,DrawMode,Sx,SepSym,Sy,EndSym);
- If AufDatei Then NoError:=IOresult=0;
- end; {$I+}
- GroldX:=Newp.X;GroldY:=Newp.Y;
- end;
- end;
- LastP:=NewP;
- Until Ready;
- end { gestrichelt }
- else
- begin
- FormReals(X2,Sx);FormReals(Y2,Sy);
- If NoError Then
- begin {$I-}
- Write(PrOutFile,DrawMode,Sx,SepSym,Sy,EndSym);
- If AufDatei Then NoError:=IOresult=0;
- end; {$I+}
- end;
- end;
- GrOldX:=X2;GrOldY:=Y2;
- End;
- end;
- GrCursorX:=X;GrCursorY:=Y;
- End;
-
- Const MoveToCircle :Boolean =true;
-
- Procedure Circle(CenterX, CenterY ,RX,RY :Real; Alpha,Beta :Integer;
- CColor: GrColor;Direction :Boolean);
- Const Epsilon_mal_8 = 8.0*0.01;
-
- Var Phi,Dphi,CPhi :Integer;
- OldX,OldY,CX,CY :Real;
- AddBeta :Integer;
- Xre,Yre,Rmax :Real;
- Ende :Boolean;
-
- Begin
- If Alpha=Beta Then AddBeta:=0;
- Normalize(Alpha);
- Normalize(Beta);
- If Beta>Alpha Then AddBeta:=0 Else AddBeta:=360;
- RX:=Abs(RX);RY:=Abs(RY);
- IF RX > RY Then Rmax:=RX else Rmax:=RY;
- { Abschätzung:
- r-r*Cos(Dphi/2) < ε
- Cos(X) ≈ 1-1/(X²*2!) (Taylor-Reihe )
- >>
- DPHI < 2*180/π* √(2*ε/r)
- }
- If Rmax <2 then Dphi:=15
- else Dphi:=Round(Winkelmass(Sqrt(Epsilon_mal_8/Rmax)));
- If Dphi<1 then Dphi:=1;
- Beta:=Beta+AddBeta;
- If Not(Direction) Then
- Begin
- Tausche (Alpha,Beta);
- DPhi:=-Dphi;
- Addbeta:=-Addbeta;
- end;
- SinusCosinus(Alpha,CY,CX);
- CX:=CX*RX;CY:=CY*Ry;
- RotReal(CX,CY);
- OldX:=CX;OldY:=CY;
- If MoveToCircle then
- Pencolor(0)
- else
- PenColor(Ccolor);
- MovetoCircle:=True;
- Moveto(CenterX+CX,CenterY+CY);
- Pencolor(CColor);
- Phi:=alpha;
- Repeat
- Phi:=PHi+DPhi;
- If Direction Then
- begin If Phi >Beta Then Phi:=Beta;end
- else
- begin If Phi <Beta Then Phi:=Beta;end;
- SinusCosinus(Phi,CY,CX);
- CX:=CX*RX;CY:=CY*Ry;
- RotReal(CX,CY);
- If Ungleich(OldX,CX) or Ungleich(OldY,CY) or (PendownCount=0) Then
- Begin
- OldX:=CX;
- OldY:=CY;
- CX:=CX+ CenterX;
- CY:=CY+ CenterY;
- Moveto(CX,CY)
- End;
- If Direction Then
- Ende:=Phi >= Beta
- else
- Ende:=Phi<=Beta;
- Until Ende;
- Pencolor(0);
- End;
-
- Procedure Eye(CenterX,CenterY,OuterDiaM,InnerDiaM :Real;
- EColor :GrColor);
- Var Save :GrLineType;
- Diminuend :Real;
- InD,SB :Real;
- Begin
- Save:=GrDotted;LineType(full);
- Pencolor(0);
- SB:=0.5*Stiftbreite;
- If PlotModus=Bestueck Then OuterDiaM:=InnerDiaM;
- If PlotModus=Testplot Then
- Diminuend:=Abs(0.499*(OuterDiaM-InnerDiaM))
- Else
- Diminuend:=0.75*Stiftbreite;
- If Diminuend<0.05 Then Diminuend:=0.05;
- OuterDiaM:=0.5*OuterDiaM;
- InnerDiam:=0.5*InnerDiaM;
- Repeat
- Circle(CenterX,CenterY,OuterDiaM,OuterDiaM,0,360,EColor,true);
- MoveToCircle:=false;
- InD:=OuterDiam-SB-0.001; { wirklicher Wert }
- OuterDiaM:=OuterDiaM-Diminuend;
- If OuterDiaM-SB-0.001<InnerDiaM Then OuterDiam:=InnerDiam+SB;
- Until (Plotmodus=Bestueck) or (InD<=InnerDiam);
- MoveToCircle:=True;
- LineType(Save);
- PenColor(0);
- End;
-
- Procedure ZeichneOval(CenterX,CenterY,OuterDiaM,Ovlen :Real;Ecolor:GrColor);
- Var Xm,Ym:Real;
- X1,Y1:Real;
- begin
- OuterDiam:=OuterDiam*0.5;
- ym:=OvLen*0.5;
- xm:=0;
- Rotreal(Xm,Ym);
- Circle(CenterX+Xm,CenterY+Ym,OuterDiaM,OuterDiaM,0,180,EColor,true);
- X1:=-OuterDiam;
- Y1:=-Ym;
- RotReal(X1,Y1);
- Pencolor(Ecolor);
- Moveto(CenterX+X1,CenterY+Y1);
- MovetoCircle:=false;
- Circle(CenterX-Xm,CenterY-Ym,OuterDiaM,OuterDiaM,180,360,EColor,true);
- X1:=OuterDiam;
- Y1:=Ym;
- RotReal(X1,Y1);
- Pencolor(Ecolor);
- Moveto(CenterX+X1,CenterY+Y1);
- end;
-
- Procedure OvalEye(CenterX,CenterY,OuterDiaM,InnerDiaM,OvalLen :Real;
- EColor :GrColor);
- Var Save :GrLineType;
- Diminuend :Real;
- InD,SB,Ovl :Real;
- Begin
- Save:=GrDotted;LineType(full);
- Pencolor(0);
- SB:=Stiftbreite;
- If PlotModus=Bestueck Then
- begin
- OuterDiaM:=InnerDiaM;
- OvalLen:=0;
- end;
- If PlotModus=Testplot Then
- begin
- If OvalLen>OuterDiam-InnerDiam then
- Diminuend:=Abs(0.998*OvalLen)
- else
- Diminuend:=Abs(0.998*(OuterDiaM-InnerDiaM));
- end
- Else
- Diminuend:=1.5*Stiftbreite;
- If Diminuend<0.1 Then Diminuend:=0.1;
-
- Repeat
- ZeichneOval(CenterX,CenterY,OuterDiaM,OvalLen,EColor);
- MovetoCircle:=false;
- InD:=OuterDiam-SB-0.002; { wirklicher Wert }
- Ovl:=OvalLen-SB-0.02;
-
- { erst OuterDiam verkleinern bis Ind<=InnerDiam
- dann Ovlen verleinern bis Ovl<=0 }
- If InD<=InnerDiam then
- OvalLen:=OvalLen-Diminuend
- else
- OuterDiaM:=OuterDiaM-Diminuend;
-
- If OuterDiaM-SB-0.002<InnerDiaM Then OuterDiam:=InnerDiam+SB;
- If OvalLen-SB-0.02<0 then OvalLen:=SB;
- Until (Plotmodus=Bestueck) or ((InD<=InnerDiam) and (Ovl<=0));
- MovetoCircle:=true;
- LineType(Save);
- PenColor(0);
- End;
-
- Procedure SqareEye(CenterX,CenterY,OuterDiaM,InnerDiaM :Real;
- EColor :GrColor);
- Var Ba,Bx1,By1,Bx2,By2,Diminuend :Real;
- Save :GrLineType;
- InD,SB :Real;
-
- Begin
- Save:=GrDotted;LineType(full);
- SB:=0.5*Stiftbreite;
- If PlotModus=Bestueck Then OuterDiaM:=InnerDiaM;
- If PlotModus=Testplot Then
- Diminuend:=Abs(0.499*(OuterDiaM-InnerDiaM))
- Else
- Diminuend:=0.75*Stiftbreite;
- If Diminuend<0.05 Then Diminuend:=0.05;
- Ba:= OuterDiaM*0.5 ;
- InnerDiaM:=0.5*InnerdiaM;
- Bx1:=Ba;By1:=Ba;Bx2:=-Ba;By2:=Ba;
- Rotreal(Bx1,By1);Rotreal(Bx2,By2);
- Pencolor(0);
- Moveto(CenterX+Bx1,CenterY+By1);
- Pencolor(EColor);
- Repeat
- Moveto(CenterX+Bx2,CenterY+By2);
- Moveto(CenterX-Bx1,CenterY-By1);
- Moveto(CenterX-Bx2,CenterY-By2);
- Moveto(CenterX+Bx1,CenterY+By1);
- InD:=Ba-SB-0.001; { wirklicher Wert }
- Ba:=Ba-Diminuend;
- If Ba-SB-0.001<InnerDiaM Then Ba:=InnerDiam+SB;
- Bx1:=Ba;By1:=Ba;Bx2:=-Ba;By2:=Ba;
- Rotreal(Bx1,By1);Rotreal(Bx2,By2);
- Until (Plotmodus=Bestueck) or (InD<=InnerDiam);
- Pencolor(0);
- LineType(Save);
- End;
-
- Procedure Octagon(CenterX,CenterY,OuterDiaM,InnerDiaM :Real;
- EColor :GrColor);
- Const Tan22_5=0.5*0.41421356237;
- _Achteck:Array[1..9] of Vektor =
- ((X: 0.5; Y: Tan22_5) , (X: Tan22_5; Y: 0.5 ),
- (X:-Tan22_5; Y: 0.5 ) , (X:-0.5; Y: Tan22_5),
- (X:-0.5; Y:-Tan22_5) , (X:-Tan22_5; Y:-0.5 ),
- (X: Tan22_5; Y:-0.5 ) , (X: 0.5; Y:-Tan22_5),
- (X: 0.5;Y: Tan22_5 ));
- Var Ba,Bx,By,Diminuend :Real;
- Save :GrLineType;
- InD,SB :Real;
- I :Integer;
-
- Begin
- Save:=GrDotted;LineType(full);
- SB:=Stiftbreite;
- If PlotModus=Bestueck Then OuterDiaM:=InnerDiaM;
- If PlotModus=Testplot Then
- Diminuend:=Abs(0.998*(OuterDiaM-InnerDiaM))
- Else
- Diminuend:=1.5*Stiftbreite;
- If Diminuend<0.1 Then Diminuend:=0.1;
- Ba:= OuterDiaM ;
- Bx:=_Achteck[1].X*Ba;
- By:=_AchtEck[1].Y*Ba;
- Rotreal(Bx,By);
- Pencolor(0);
- Moveto(CenterX+Bx,CenterY+By);
- Pencolor(EColor);
- Repeat
- For I:=2 to 9 do
- begin
- Bx:=_Achteck[I].X*Ba;
- By:=_AchtEck[I].Y*Ba;
- Rotreal(Bx,By);
- Moveto(CenterX+Bx,CenterY+By);
- end;
- InD:=Ba-SB-0.002; { wirklicher Wert }
- Ba:=Ba-Diminuend;
- If Ba-SB-0.002<InnerDiaM Then Ba:=(InnerDiam+SB);
- Until (Plotmodus=Bestueck) or (InD<=InnerDiam);
- Pencolor(0);
- LineType(Save);
- End;
-
- Procedure Rectangle(X,Y,L,B,Margin :Real;RColor : GrColor);
- Var RX,RY,Limit,Offset,Increment :Real;
- Last,Ende,Once :Boolean;
- Begin
- L:=Abs(L);B:=Abs(B);Margin:=Abs(Margin);
- IF B > L Then
- Limit:=L
- Else Limit:=B;
- Limit:=0.5*Limit;
- If Margin+PlotRes < Limit Then
- begin
- Limit:=Margin;
- Once:=Margin<1.1*Stiftbreite;
- Limit:=Limit-0.6*Stiftbreite;
- end
- else
- begin
- Once:=false;
- Limit:=Limit-0.35*Stiftbreite;
- end;
- Offset:=0;
- If (PlotModus=TestPlot) and Not(Once) then
- Increment:=5*Stiftbreite
- else
- Increment:=0.75*Stiftbreite;
- If Increment<0.05 Then Increment:=0.05;
- Pencolor(0);
- Moveto(X,Y);
- Pencolor(RColor);
- Last:=false;
- Repeat
- RX:=L-Offset;RY:=Offset;
- Rotreal(RX,RY);
- Moveto(X+RX,Y+RY);
- RX:=L-Offset;RY:=B-Offset;
- Rotreal(RX,RY);
- Moveto(X+RX,Y+RY);
- RX:=Offset;RY:=B-Offset;
- Rotreal(RX,RY);
- Moveto(X+RX,Y+RY);
- RX:=Offset;
- Offset:=Offset+Increment;
- Ende:=Last;
- If (Offset>Limit) and Not(Once) then begin Offset:=Limit;Last:=true;end;
- RY:=Offset;
- Rotreal(RX,RY);
- Moveto(X+RX,Y+RY);
- Until Once or Ende;
- Pencolor(0);
- End;
-
- Procedure Pfeilspitze(SpitzeX,SpitzeY,Laenge :Real;EColor :GrColor);
- Const _Peek :Array[1..4] of Vektor =
- ((X: -2/3; Y: 0.0 ) , (X: 1/3; Y: 0.13333),
- (X: 1/3; Y:-0.13333) , (X:-2/3; Y: 0.0 ));
-
- Var Bx,By,Diminuend :Real;
- Save :GrLineType;
- InD,SB :Real;
- I :Integer;
-
- Begin
- Save:=GrDotted;LineType(full);
- SB:=Stiftbreite;
- Bx:=0.666667*Laenge;
- By:=0;
- RotReal(Bx,By);
- SpitzeX:=SpitzeX+Bx;
- SpitzeY:=SpitzeY+By;
- Laenge:=Laenge-Stiftbreite;
- Diminuend:=2.5*Stiftbreite;
- If Diminuend<0.1 Then Diminuend:=0.1;
- Bx:=_peek[1].X*Laenge;
- By:=_peek[1].Y*Laenge;
- Rotreal(Bx,By);
- Pencolor(0);
- Moveto(SpitzeX+Bx,SpitzeY+By);
- Pencolor(EColor);
- Repeat
- For I:=2 to 4 do
- begin
- Bx:=_peek[I].X*Laenge;
- By:=_peek[I].Y*Laenge;
- Rotreal(Bx,By);
- Moveto(SpitzeX+Bx,SpitzeY+By);
- end;
- InD:=0.33*Laenge-SB-0.002; { wirklicher Wert }
- Laenge:=Laenge-Diminuend;
- If 0.33*Laenge-SB-0.002<0 then Laenge:=SB;
- Until (Plotmodus=TestPlot) or (InD<=0);
- Pencolor(0);
- LineType(Save);
- End;
-
- Procedure LinePaint(X0,Y0,XE,YE :Real; B :Real;Color :GrColor;
- Adapt :Boolean);
- Type Point = Record
- X,Y :Real;
- end;
- Var OldPhi,Alpha :Integer;
- Bhalbe,Dx,Dy,Sb,Laenge,Gesamt,LX,LY,Xp,Yp :Real;
- P1,P2,P3,P4 :Point;
- Procedure GetDXY(Var P :Point);
- begin
- Dx:=P.X*Bhalbe;
- Dy:=P.Y*Bhalbe;
- end;
- Begin
- Sb:=Stiftbreite;
- If B<=1.1*Sb Then { 10% der Stiftbreite Toleranz }
- begin
- Pencolor(0);
- Moveto(X0,Y0);
- Pencolor(Color);
- Moveto(XE,YE);
- end
- else
- Begin
- B:=B-Sb;
- If Adapt Then
- begin
- P1.X:=0.0;P1.Y:=1.0;
- P4.X:=0.0;P4.Y:=-1.0;
- P2.X:=-0.75;P2.Y:=0.5;
- P3.X:=-0.75;P3.Y:=-0.5;
- end
- else
- begin
- P1.X:=0.0;P1.Y:=1.0;
- P4.X:=0.0;P4.Y:=-1.0;
- P2.X:=0.0;P2.Y:=0.5;
- P3.X:=0.0;P3.Y:=-0.5;
- end;
- LX:=XE-X0;LY:=YE-Y0;
- Laenge:=Sqrt(Sqr(LX)+Sqr(LY))+B;
- Gesamt:=0.0;
- OldPhi:=GrRotPhi;
- Alpha:=CalcPhi(Realtoint(PlotKoord(XE-X0)),RealtoInt(PlotKoord(YE-Y0)));
- Turnto(Alpha);
- SB:=SB*0.75;
- If Sb<0.05 Then Sb:=0.05;
- Bhalbe:=0.5*B;
- RotReal(P1.X,P1.Y);
- RotReal(P2.X,P2.Y);
- RotReal(P3.X,P3.Y);
- RotReal(P4.X,P4.Y);
- GetDXY(P1);
- Pencolor(0);Moveto(X0+Dx,Y0+Dy);
- Pencolor(Color);
- Repeat
- If Adapt Then
- begin
- GetDXY(P2);Moveto(X0+Dx,Y0+Dy);
- GetDXY(P3);Moveto(X0+Dx,Y0+Dy);
- end;
- GetDXY(P4);Moveto(X0+Dx,Y0+Dy);
- GetDXY(P1);Moveto(XE-Dx,YE-Dy);
- If Adapt Then
- begin
- GetDXY(P2);Moveto(XE-Dx,YE-Dy);
- GetDXY(P3);Moveto(XE-Dx,YE-Dy);
- end;
- GetDXY(P4);Moveto(XE-Dx,YE-Dy);
- GetDXY(P1);Moveto(X0+Dx,Y0+Dy);
- Gesamt:=Gesamt+Laenge;
- If Gesamt>70.0 Then
- Begin
- PenColor(0);
- Moveto(X0+Dx+2.0*PlotRes,Y0+Dy);
- Moveto(X0+Dx,Y0+Dy);
- Pencolor(Color);
- Gesamt:=0.0;
- End;
- B:=B-Sb;
- Bhalbe:=0.5*B;
- If Plotmodus<>Testplot Then
- begin GetDXY(P1);Moveto(X0+Dx,Y0+Dy); end;
- Until (B<0.0) or (Plotmodus=TestPlot);
- Turnto(OldPhi);
- End;
- End;
-
- Function TextLaenge(Var T:Bildelement):Integer;
- Var Ch :Char;
- Index :CHIptr;
- Grafset :ChFptr;
- Xsum,I,Ci :Integer;
- Begin
- With T Do
- begin
- If (Art and 16)>0 then
- begin Index:=CharIndex2; Grafset:=Grafset2; end
- else
- begin Index:=CharIndex1; Grafset:=Grafset1; end;
- Xsum:=0;
- If (Art and 4) >0 then { Proportional}
- For I:= 1 To Length(WortLaut) Do
- Begin
- Ci:=Ord(Wortlaut[I])-32;
- If Ci<0 then Ci:=0;
- Xsum:=Xsum+(Grafset^[Index^[Ci]].CharX and $F);
- End
- else Xsum:=Length(Wortlaut) shl 3;
- If (Art and 8)>0 then Xsum:=(3*Xsum) shr 2; {*0.75} { Schmalschrift }
- If (Art and 2)>0 then Xsum:=-Xsum; { gespiegelt }
- TextLaenge:=RealtoInt(Hoehe*0.125*Xsum);
- End;
- End;
- Procedure Wstring(X,Y :Real; YourText :Str80 ; SColor :GrColor;
- Size :Real; ChTyp :GrChType) ;
-
- Var I :Integer;
- OfsetY,
- SX,SY,
- Breite,Rchar :Real;
- Ch :Char;
- Cursive,Spiegel :boolean;
- Schmal,Prop :Boolean;
- Index :CHIptr;
- Grafset :ChFptr;
- LenSc,Chsc :Real;
- Xsum :Integer;
- Charindex,
- Nkanten :Integer;
- Xofset :Integer;
- Xprop :Integer;
- Save : GrLineType;
-
-
- Procedure WChar (X,Y:Real;Cindex,Nk :Integer);
- Var CX,CY,I :Integer;
- Cxr,Cyr :Real;
- X0,Y0 :Real;
- Begin
- If (Grafset^[Succ (Cindex) ].CharY and $80)>0 then
- { Startposition anfahren }
- begin
- CX:=Xofset;
- If Schmal then CX:=Cx*3 else Cx:=Cx shl 2; {*0.75}
- If Spiegel Then CX:=-CX;
- CXr:=CX*Chsc;
- CYr:=0.0;
- Rotreal(CXr,CYr);
- CXr:=Cxr+X;
- CYr:=Cyr+Y;
- Pencolor(0);Moveto(Cxr,Cyr);
- end;
- X0:=X;Y0:=Y;
- For I:=1 to Nk Do
- With Grafset^[Cindex+I] Do
- Begin
- CX:=CharX*3; { /4} {*0.75}
- Inc(CX,Xofset);
- CY:=CharY and $7F;
- If Cursive Then Inc(CX,CY); {+ Y/4}
- If Schmal then CX:=Cx*3 else Cx:=Cx shl 2; {*0.75}
- CY:=CY shl 4;
- If Spiegel Then CX:=-CX;
- CXr:=CX*Chsc;
- CYr:=CY*Chsc;
- Rotreal(CXr,CYr);
- CXr:=Cxr+X;
- CYr:=Cyr+Y;
- If (CharY and $80)=0 Then
- begin
- Pencolor(0);
- Moveto(CXr,CYr);
- end
- Else
- Linepaint(X0,Y0,Cxr,Cyr,Breite,SColor,true);
- X0:=Cxr;Y0:=Cyr;
- end;
- End;
-
- Begin
- RChar:=25.0*Size;
- Save:=GrDotted;LineType(full);
- Cursive:=(Chtyp and 1)>0;
- Spiegel:=(Chtyp and 2)>0;
- Prop:=(Chtyp and 4)>0;
- Schmal:=(Chtyp and 8)>0;
- If (Chtyp and 16)>0 then
- begin Index:=CharIndex2; Grafset:=Grafset2; end
- else
- begin Index:=CharIndex1; Grafset:=Grafset1; end;
- If Schmal then LenSc:=Size*0.09375 else LenSc:=Size*0.125;
- CHsc:=Size*4.61368E-4;{*15/(16*127)*0.0625};
- OfsetY:=Size*0.0625+0.1;
- If PlotModus=Testplot then
- Breite:=0
- else
- begin
- Breite:=Size*SchriftDicke;
- If Breite<StiftBreite then Breite:=0;
- If Breite>0.2*Size then Breite:=0.2*Size;
- end;
- Xsum:=0;
- Xofset:=0;
- For I:= 1 To Length(YourText) Do
- Begin
- SX:=Xsum*LenSc;
- If Spiegel then SX:=-SX;
- SY:=OfsetY;
- Rotreal(SX,SY);
- SX:=SX+X;SY:=Sy+Y;
- CharIndex:=Ord(YourText[I])-32;
- If CharIndex<0 then CharIndex:=0;
- CharIndex:=Index^[CharIndex];
- With Grafset^[CharIndex] Do
- begin
- Xprop:=CharX and $F;
- Nkanten:=Pred( CharY );
- end;
- If Prop then
- begin
- Xofset:=Xprop shl 3;
- Inc(Xsum,xprop);
- end
- else
- begin
- Xofset:=(32-Xprop*3) shl 3;
- Inc(Xsum,8);
- end;
- WChar(SX,SY,CharIndex,Nkanten);
- End;
- Pencolor(0);
- LineType(Save);
- End;
-
- Procedure Pfeil(X,Y,Laenge,Groesse:Real; MText :Str80;
- Color :GrColor);
- Var TextLaenge,
- AXtext,AYText,
- InitX,InitY,EndX,EndY,
- L0x,L0y,PL,PH,Px,Py,Px1,Py1 :Real;
- Aussen :Boolean;
- Hoehe :Real;
- Procedure Stretch(Var X:Real);
- Begin
- X:=Groesse*X;
- End;
- Begin
- With SetupInfo.Voreinstellung Do
- Hoehe:=Einheit*Masshoehe;
- TextLaenge:=Hoehe*Length(MText);
- Laenge:=Abs(Laenge);
- With SetupInfo.Voreinstellung do
- begin
- AYText:=Einheit;PL:=Einheit*Masshoehe;PH:=Pl*0.3;
- L0x:=Laenge;L0Y:=0;
- InitY:=0;EndY:=L0y;
- If TextLaenge<Laenge-(PL*2.0) Then
- Begin
- AXtext:=0.5*(Laenge-TextLaenge);
- InitX:=0.0;EndX:=L0x;
- Aussen:=false;
- End
- Else
- Begin
- AXtext:=Laenge+PL+Einheit;
- InitX:=-PL*2.0;
- EndX:=Axtext+TextLaenge+Einheit*4.0;
- Aussen:=true;
- End;
- end;
- Stretch(AxText);Stretch(AyText);
- Stretch(InitX);Stretch(EndX);
- Stretch(L0X);Stretch(PL);Stretch(PH);
- Stretch(Hoehe);
- Rotreal(InitX,InitY);
- Pencolor(0);Moveto(X+InitX,Y+InitY);
- Rotreal(EndX,EndY);Rotreal(L0x,L0y);
- L0x:=L0x+X;L0y:=L0y+Y;
- Pencolor(Color);Moveto(X+EndX,Y+EndY);
- If Aussen Then PL:=-PL;
- Px:=PL;Py:=PH;Rotreal(Px,Py);
- Px1:=X+Px;Py1:=Y+Py;
- Pencolor(0);Moveto(Px1,Py1);
- Pencolor(Color);Moveto(X,Y);
- Px:=PL;Py:=-PH;Rotreal(Px,Py);
- Moveto(X+Px,Y+Py);
- Moveto(Px1,Py1);
- Px:=-PL;Py:=PH;Rotreal(Px,Py);
- Px1:=L0X+Px;PY1:=L0Y+Py;
- Pencolor(0);Moveto(Px1,Py1);
- Pencolor(Color);Moveto(L0X,L0Y);
- Px:=-PL;Py:=-PH;Rotreal(Px,Py);
- Moveto(L0X+Px,L0Y+Py);
- Moveto(Px1,Py1);
- Rotreal(AxText,AyText);
- Pencolor(0);
- Wstring(X+AxText,Y+AyText,Mtext,Color,Hoehe,0);
- End;
-
- Procedure InitBackSc;
- begin
- With SetupInfo.Voreinstellung Do
- BackScale:=PlotRes/(PlotScale*Einheit);
- end;
-
- Procedure InitLayersetofPen;
- Var Pen,Ebene :Integer;
- begin
- For Pen:=1 to 9 Do
- begin
- LayersetofPen[Pen]:=[];
- For Ebene:=0 to Maxlayer do
- If PenLookUp[EbenenIndex(Ebene)]=Pen Then
- LayerSetofPen[Pen]:=LayersetofPen[Pen]+[Ebene];
- LayerSetofPen[Pen]:=LayersetofPen[Pen] * Plotlayers;
- end;
- end;
-
- Procedure PlotReset;
- Begin
- GrCursorX:=0;
- GrCursorY:=0;
- GrOldX:=0;
- GrOldY:=0;
- PlOldPen:=0;
- GrDotted:=full;
- PendownCount:=0;
- LastLineType:=Full;
- With SetupInfo.PinstInfo do
- If NoError Then
- begin {$I-}
- If ResetCom<>'' Then Write(PrOutFile,Resetcom,EndSym);
- If AufDatei Then NoError:=IOresult=0;
- end; {$I+}
- PenColor(0);Moveto(0,0);
- End;
-
- Function Istmass(Origin: Integer):Real;
- Begin
- With SetupInfo.Voreinstellung Do
- Istmass:=Origin*Einheit;
- End;
-
- Function Rastermass(Mass : Real):Integer;
- Begin
- With SetupInfo.Voreinstellung Do
- Rastermass:=RealtoInt(Mass/Einheit);
- End;
-
-
-